package models

import (
	"time"

	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Username       string    `gorm:"column:username;uniqueIndex;not null"`
	Name           string    `gorm:"column:name;not null"`
	Password       string    `gorm:"column:password;not null"`
	Token          string    `gorm:"column:token;uniqueIndex"`
	AboutMe        string    `gorm:"column:about_me"`
	Address        string    `gorm:"column:address"`
	Phone          string    `gorm:"column:phone"`
	WebSite        string    `gorm:"column:web_site"`
	LastLoginTime  time.Time `gorm:"column:last_login_time"`
	IsDelete       bool      `gorm:"column:is_delete;default:false"`
	IsGetEmail     bool      `gorm:"column:is_delete;default:true"`
	LoginFailCount int       `gorm:"column:login_fail_count;default:0"`
	BanTime        time.Time `gorm:"column:ban_time"`
}

// TableName 指定表名
func (User) TableName() string {
	return "note_users"
}
